package com.example.innospace.demos.pojo.enums;

/**
 * 常用 HTTP 响应码枚举类
 */
public enum ResponseCodeEnum {
    SUCCESS(200),//"请求成功"
    BAD_REQUEST(400),//, "请求参数错误"
    UNAUTHORIZED(401),//, "未授权，请登录"
    FORBIDDEN(403),//, "权限不足，禁止访问"
    NOT_FOUND(404),//, "资源未找到"
    METHOD_NOT_ALLOWED(405),//, "请求方法不被允许"
    INTERNAL_SERVER_ERROR(500),//, "服务器内部错误"
    SERVICE_UNAVAILABLE(503);//, "服务不可用"

    private final int code;

    ResponseCodeEnum(int code) {
        this.code = code;

    }

    public int getCode() {
        return code;
    }



    @Override
    public String toString() {

        return String.format("%d", this.code);
    }
}